﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;

namespace Shop.Core.WeChat
{
    public static class ServiceCollectionExtension
    {
        public static IServiceCollection AddWeChatServices(this IServiceCollection services, WeChatConfig config)
        {
            services.AddSingleton<WeChatConfig>(config);
            services.AddSingleton<AccessToken>();
            services.AddScoped<WeChatService>();
            return services;
        }
    }
}
